package com.qf.demo;

import com.qf.pojo.Animal;
import com.qf.pojo.User;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @ClassName Demo
 * @Description TODO
 * @Author 86181
 * @Date 2022/8/29 23:05
 * @Version 1.0
 **/
public class Demo {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean.xml");
        //获取bean,默认是个单列
        User user = (User) applicationContext.getBean("user1");
        System.out.println(user);
        Animal animal=(Animal) applicationContext.getBean("animal");
        System.out.println(animal);
    }
}
